Skip to main content

v8.3.3

This release adds per-recipient email open and click tracking to the Postmark webhook pipeline and the Email Log UI. Webhook events are now linked to the recipient they belong to, Click events record the clicked URL, and the Email Log show page surfaces per-recipient open counts and click details.

Required Migration (Existing Installs)​

CmWebhookEvent now carries two new pieces of data, both populated at webhook receipt:

ColumnTypePurpose
recipientpolymorphic + indexThe recipient the event belongs to (matched by MessageID + payload recipient email against the log's record)
original_linkstringFor Click events, the clicked URL — denormalized at receipt so clicks can be grouped and counted in SQL

Events for CC/BCC recipients of the same message stay unlinked (recipient: nil) so they are never attributed to the To recipient.

Migration Steps​

  1. Run the Add Webhook Event Recipient generator, then migrate:
rails generate cm_admin:add_webhook_event_recipient
rails db:migrate

The generated migration:

  • Adds recipient_type (string), recipient_id (bigint), and a composite index on both — each step is skipped if it already exists.
  • Adds original_link (string) — skipped if the column already exists.
  • Is idempotent (column_exists? / index_exists? guards) and safe to re-run.
note

Fresh installs don't need the extra generator — the create_cm_webhook_events template now includes the new columns.

warning

Recipient attribution happens when a webhook is received. Historical events are not backfilled — they keep recipient: nil, and repeat-open history only exists from the upgrade onward (Postmark only retains the first open server-side).

New Features​

clicked Recipient Status​

A new clicked status sits after opened in the recipient status flow and renders with a purple badge:

FromAllowed transitions
deliveredopened, clicked
openedclicked
clicked(terminal)

opened and clicked are both treated as open-equivalent statuses (CmEmailLog::OPEN_EQUIVALENT_STATUSES) so click-stage recipients still count as engaged.

Email Log Show Page Additions​

  • Recipients table now shows First Opened At, Total Opens, and Link Clicks per recipient, built from the log's webhook events via recipients_with_engagement.
  • Click Details section (shown when the log has clicks): one row per clicked link with its click count and click rate, sorted by click count.
  • Events tab: the log's webhook events with recipient, event type, created/processed timestamps, and error message.

The CmWebhookEvent index page also gains a Recipient column.

Internal Changes​

status_helper_icon Renamed to cm_info_tooltip​

The badge tooltip helper in CmAdmin::ViewHelpers::FieldDisplayHelper was renamed and now sets bs_container: 'body' so tooltips render correctly inside scrollable containers. No action is needed unless your application called status_helper_icon directly.

Checklist​

  1. Run rails generate cm_admin:add_webhook_event_recipient && rails db:migrate (existing installs only — fresh installs get the columns from create_cm_webhook_events).